from selenium import webdriver
import time

# 声明浏览器
browser = webdriver.Chrome()
browser.implicitly_wait(3)

# 找到html文件并打开
Path_name = 'D:/Python学习-100天/Day55/selenium.html'
browser.get(Path_name)

# 将浏览器最大化
time.sleep(0.5)
browser.maximize_window()

time.sleep(2)
upload = browser.find_element_by_css_selector('[name="upload"]').send_keys(Path_name)

time.sleep(2)
submit = browser.find_element_by_css_selector('[type="submit"]').click()


time.sleep(2)
# 关闭浏览器
browser.quit()